$(document).ready(function(){
    $("body").height($(window).height());
    var $headerHeight = $("header").height();
    var $footerHeight = $("footer").height();
    var $bannerHeight = $("#banner").height();
    var $yunzo_bg = $("body").height()-($headerHeight+$footerHeight+$bannerHeight);
    $("#yunzo-bg").height($yunzo_bg);
    $("#personal").attr("href","personal.html?mid="+getUrlParam("mid")+"&businessId="+getUrlParam("businessId"));
    $("#index").attr("href","index.html?mid="+getUrlParam("mid")+"&businessId="+getUrlParam("businessId"));
    //getFiveInfoList();
    //getAllCountryEBusinessList();
    //getAllCountryCity();
    getAllCountryGroups();
    //getAllCountryBusinessList();
});
var t= n = 0,count;
$(document).ready(function() {
    count = $("#banner_list a").length;
    $("#banner_list a:not(:first-child)").hide();
    $("#banner>ul>li").click(function(){
        var i = $(this).index();
        n = i;
        if(i>=count) return;
        $("#banner_list a").filter(":visible").fadeOut(500).parent().children().eq(i).fadeIn(500);
        document.getElementById("banner").style.background ="";
        $(this).toggleClass("on");
        $(this).siblings().removeAttr("class");
    });
    t = setInterval("showAuto()",4000);
    $("#banner").hover(function(){
        clearInterval(t);
    },function(){
        t = setInterval("showAuto()",4000);
    });
});
function getFiveInfoList() {
	var Post ="mid="+basedata.mid+"&groupid="+basedata.groupid+"&token="+basedata.token+"&did="+commondata.yunzocircle;
	$.ajax({
		url:'../api/group/gettopfiveinfolist',
		type:'post',
		data:Post,
		success:function(msg){
			alert(msg);
		}
	});
}
//获取全国电商列表
function getAllCountryEBusinessList() {
	var Post ="mid="+basedata.mid+"&groupid="+basedata.groupid+"&token="+basedata.token+"&did="+commondata.yunzocircle+
	"&pagesize=10&type=1";
	$.ajax({
		url:'../api/group/getgroupecprodinfolist',
		type:'post',
		data:Post,
		success:function(){
			
		}
	});	
}
//获取团体
function getAllCountryGroups() {
	var Post ="mid="+basedata.mid+"&groupid="+basedata.groupid+"&token="+basedata.token+"&did="+commondata.yunzocircle+"&pagesize=10";
	$.ajax({
		url:'../api/group/getallgroupinfolist',
		type:'post',
		data:Post,
		success:function(){
			
		}
	});	
}
//获取城市
function getAllCountryCity() {
	var Post ="mid="+basedata.mid+"&groupid="+basedata.groupid+"&token="+basedata.token+"&did="+commondata.yunzocircle+"&pagesize=10";
	$.ajax({
		url:'../api/group/getallcityinfolist',
		type:'post',
		data:Post,
		success:function(){
			
		}
	});	
}
//获取全国商机
function getAllCountryBusinessList() {
	var Post ="mid="+basedata.mid+"&groupid="+basedata.groupid+"&token="+basedata.token+"&did="+commondata.yunzocircle+
	"&pagesize=10&type=1";
	$.ajax({
		url:'../api/group/getgroupbusinessinfolist',
		type:'post',
		data:Post,
		success:function(){
			
		}
	});	
}
function checkUpdate() {
	
}
function showAuto() {
    n = n >= (count - 1) ? 0 : ++n;
    $("#banner>ul>li").eq(n).trigger("click");
}
function getUrlParam(name) {
	var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
	var r = window.location.search.substr(1).match(reg);
	if (r != null) return unescape(r[2]); return null;
}